import { defHttp } from "/@/utils/http/axios";

enum Api {
  //业务 - 挂账合并 - 列表
  onPaymentList    =  '/account/onPaymentList',
  //业务 - 挂账合并 - 表单
  paymentInput     =  '/account/paymentInput',
  //业务 - 挂账合并 - 提交
  ajaxAccountOnTrustRefer  = '/account/ajaxAccountOnTrustRefer',

  //经理 - 付款审批
  payManageChecked  =  '/accountFlow/payManageChecked',
  //经理 - 挂账审批
  takeManageChecked =  '/accountFlow/takeManageChecked',

  //账务 - 收款审核
  takeFinaneChecked =  '/accountFlow/takeFinaneChecked',
  //账务 - 转账支付
  payFinaneChecked  =  '/accountFlow/payFinaneChecked',
  //账务 - 转账导出
  payFinaneExportXls = '/accountFlow/payFinaneExportXls',
  //账务 - 挂账支付
  takePayment       =  '/accountFlow/takePayment',

  inputpay = '/accountFlowController.do?inputpay',
  //href="${ctx}/bankRunningController.do?inputrec"

  //审核 - 业务信息
  getRecordById =  '/accountFlow/getRecordById',
  //审核 - 收支明细
  loadAccount = '/account/loadAccount',
  //审核 - 合并支付 - 审核列表 2025-09-13
  loadAccountFlow = '/accountFlow/loadAccountFlow',
  //审核 - 合并支付 - 收支项目 2025-09-13
  loadAccountByParentId = '/accountFlow/loadAccountByParentId',
  //审核 - 银行流水
  loadBankRunning = '/bankRunning/loadBankRunning',
  //审核 - 分解流水
  loadBankBalance = '/bankBalance/loadBankBalance',
  //审核 - 订单明细
  loadBusinessAccount = '/account/ajaxBusinessAccountTable',
  //审核 - 审核
  audit = '/accountFlow/audit',
  //审核 - 转账审核
  collateRecordJson = '/accountFlow/collateRecordJson',
  //审核 - 回退
  deleteRecordJson = '/accountFlow/deleteRecordJson',
  //审核 - 取消
  rollbackRecord = '/accountFlow/rollbackRecord',
  //显示 - 回退数
  countbackRecord = '/accountFlow/countbackRecord',

  //打印 - 列表
  printDataGrid = '/accountPrint/list',
  //打印 - 添加
  printAdd = '/accountPrint/add',
  //打印 - 数据
  printById = '/accountPrint/queryById',
  //打印 - 编辑
  printEdt = '/accountPrint/edit',
  //打印 - 删除
  printDel = '/accountPrint/delete',
}

/**
 * 经理 - 转账审批
 * @param params
 */
export const payManageChecked = (params) => defHttp.get({url: Api.payManageChecked, params}, {joinParamsToUrl: true});

/**
 * 经理 - 挂账列表
 * @param params
 */
export const onPaymentList = (params) => defHttp.get({url: Api.onPaymentList, params}, {joinParamsToUrl: true});

/**
 * 经理 - 挂账合并
 * @param params
 */
export const onPaymentInput = (params) => defHttp.post({url: Api.paymentInput, params});

/**
 * 经理 - 挂账提交
 * @param params
 */
export const ajaxAccountOnTrustRefer = (params) => {
  return defHttp.post({url: Api.ajaxAccountOnTrustRefer, params, timeout: 60000}, {isTransformResponse:false});
}

/**
 * 经理 - 挂账审批
 * @param params
 */
export const takeManageChecked = (params) => defHttp.get({url: Api.takeManageChecked, params}, {joinParamsToUrl: true});

/**
 * 账务 - 转账审批
 * @param params
 */
export const takeFinaneChecked = (params) => defHttp.get({url: Api.takeFinaneChecked, params}, {joinParamsToUrl: true});

/**
 * 账务 - 转账支付
 * @param params
 */
export const payFinaneChecked = (params) => defHttp.get({url: Api.payFinaneChecked, params}, {joinParamsToUrl: true});

/**
 * 账务 - 转账导出
 * @param params
 */
export const payFinaneExportXls = Api.payFinaneExportXls;

/**
 * 账务 - 挂账支付
 * @param params
 */
export const takePayment = (params) => defHttp.get({url: Api.takePayment, params}, {joinParamsToUrl: true});

/**
 * 审核 - 初始化数据
 * @param params
 */
export const audit = (params) => defHttp.get({url: Api.audit, params}, {isTransformResponse:false});

/**
 * 审核 - 业务信息
 * @param params
 */
export const getRecordById = (params) => defHttp.get({url: Api.getRecordById, params},{isTransformResponse:false});

/**
 * 审核 - 业务信息
 * @param params
 */
export const loadAccount = (params) => {
  if (params.uncouple == '1') {
    return defHttp.post({url: Api.loadAccountByParentId, params},{isTransformResponse:false});
  } else {
    return defHttp.post({url: Api.loadAccount, params},{isTransformResponse:false});
  }
}

/**
 * 审核 - 合并列表
 * @param params
 */
export const loadAccountFlow = (params) => defHttp.get({url: Api.loadAccountFlow, params},{isTransformResponse:false});

/**
 * 审核 - 业务信息
 * @param params
 */
export const loadBankRunning = (params) => defHttp.get({url: Api.loadBankRunning, params},{isTransformResponse:false});

/**
 * 审核 - 业务信息
 * @param params
 */
export const loadBankBalance = (params) => defHttp.get({url: Api.loadBankBalance, params},{isTransformResponse:false});

/**
 * 审核 - 业务信息
 * @param params
 */
export const collateRecordJson = (params) => defHttp.get({url: Api.collateRecordJson, params},{isTransformResponse:false});

/**
 * 审核 - 业务信息
 * @param params
 */
export const deleteRecordJson = (params) => defHttp.get({url: Api.deleteRecordJson, params, timeout: 60000},{isTransformResponse:false});

/**
 * 取消 - 业务信息
 * @param params
 */
export const rollbackRecord = (params) => defHttp.get({url: Api.rollbackRecord, params},{isTransformResponse:false});

/**
 * 回退 - 显示挂账回退数
 * @param params
 */
export const countbackRecord = (params) => defHttp.get({url: Api.countbackRecord, params});

/**
 * 审核 - 收支明细
 * @param params
 */
export const loadBusinessAccount = (params) => defHttp.get({url: Api.loadBusinessAccount, params},{isTransformResponse:false});


/**
 * 打印 - 列表
 * @param params
 */
export const printDataGrid = (params) => defHttp.get({url: Api.printDataGrid, params});


/**
 * 打印 - 添加
 * @param params
 */
export const printAdd = (params) => defHttp.get({url: Api.printAdd, params},{isTransformResponse:false});
